const mysql = require("mysql");

let pools = mysql.createPool({
    host: "192.168.42.166",
    user: "root",
    password: "ddd",
    database: "mydb"
})

function excute(sqlString, condition) {
    let promise = new Promise((resolve, reject) => {
        pools.query(sqlString, condition, function(error, result, fields) {
            if(error) {
                reject(error);
            }
            else {
                resolve(result);
            }
        })
    })
    return promise;
    
}

module.exports = {
    EXCUTE: excute
}





